package com.tanhua.model.mongo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.geo.GeoJsonPoint;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

/**
 * {
 *     "_id": ObjectId("60c063c7df466661a75d17ff"),
 *     "userId": NumberLong("106"),
 *     "likeUserId": NumberLong("11"),
 *     "isLike": false,
 *     "created": NumberLong("1623221191763"),
 *     "updated": NumberLong("1623221191763"),
 *     "_class": "com.tanhua.model.mongo.UserLike"
 * }
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "user_like")
public class UserLike implements Serializable {

    private static final long serialVersionUID = 3120608100646386050L;
    private ObjectId id;
    private Long created; //创建时间

    @Indexed
    private Long userId; //用户id，自己
    @Indexed
    private Long likeUserId; //喜欢的用户id，对方
    @Indexed
    private Boolean isLike;

    @Indexed
    private Long updated;


}
